-
Notifications
You must be signed in to change notification settings - Fork 1
Update eks.go #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update eks.go #24
Conversation
WalkthroughThis change updates the assignment of Changes
Sequence Diagram(s)sequenceDiagram
participant EKS_Sync as EKS Sync Logic
participant RelationshipRules as Relationship Rules
EKS_Sync->>RelationshipRules: Define relationship with updated Kind/Version assignments
Possibly related PRs
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| SourceKind: "AWSElasticKubernetesService", | ||
| SourceVersion: "ctrlplane.dev/kubernetes/cluster/v1", | ||
| TargetKind: "AWSNetwork", | ||
| TargetVersion: "ctrlplane.dev/network/v1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Approve: This change correctly aligns field semantics with field names.
The swap of values between Kind and Version fields is appropriate. Now "Kind" fields properly contain resource type identifiers, while "Version" fields hold API group/version paths. This matches how these fields are used elsewhere in the code (e.g., in the api.AgentResource struct at line 209-212).
🏁 Script executed:
#!/bin/bash
# Check if there are other similar relationship rules in the codebase
# that might need the same correction for consistency
# Find all usages of CreateResourceRelationshipRule to verify field naming conventions
rg -A 10 "CreateResourceRelationshipRule" --type goLength of output: 6955
Approve EKS change; align RDS and CloudSQL as well
The swap in cmd/ctrlc/root/sync/aws/eks/eks.go correctly matches Kind ↔ Version semantics. For consistency, please apply the same fixes to:
• cmd/ctrlc/root/sync/aws/rds/rds.go
• cmd/ctrlc/root/sync/google/cloudsql/cloudsql.go
Suggested diffs:
// cmd/ctrlc/root/sync/aws/rds/rds.go
- SourceKind: "ctrlplane.dev/database/v1",
- SourceVersion: "AWSRelationalDatabaseService",
+ SourceKind: "AWSRelationalDatabaseService",
+ SourceVersion: "ctrlplane.dev/database/v1",
- TargetKind: "ctrlplane.dev/network/v1",
- TargetVersion: "AWSNetwork",
+ TargetKind: "AWSNetwork",
+ TargetVersion: "ctrlplane.dev/network/v1",// cmd/ctrlc/root/sync/google/cloudsql/cloudsql.go
- SourceKind: "ctrlplane.dev/database/v1",
- SourceVersion: "GoogleCloudSQL",
+ SourceKind: "GoogleCloudSQL",
+ SourceVersion: "ctrlplane.dev/database/v1",
- TargetKind: "ctrlplane.dev/network/v1",
- TargetVersion: "GoogleNetwork",
+ TargetKind: "GoogleNetwork",
+ TargetVersion: "ctrlplane.dev/network/v1",This ensures all providers use Kind for resource type and Version for API group/version.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| SourceKind: "AWSElasticKubernetesService", | |
| SourceVersion: "ctrlplane.dev/kubernetes/cluster/v1", | |
| TargetKind: "AWSNetwork", | |
| TargetVersion: "ctrlplane.dev/network/v1", | |
| // cmd/ctrlc/root/sync/aws/rds/rds.go | |
| … | |
| CreateResourceRelationshipRule( | |
| agent, | |
| ResourceRelationshipRule{ | |
| SourceKind: "AWSRelationalDatabaseService", | |
| SourceVersion: "ctrlplane.dev/database/v1", | |
| TargetKind: "AWSNetwork", | |
| TargetVersion: "ctrlplane.dev/network/v1", | |
| }, | |
| ) | |
| … |
| SourceKind: "AWSElasticKubernetesService", | |
| SourceVersion: "ctrlplane.dev/kubernetes/cluster/v1", | |
| TargetKind: "AWSNetwork", | |
| TargetVersion: "ctrlplane.dev/network/v1", | |
| // cmd/ctrlc/root/sync/google/cloudsql/cloudsql.go | |
| … | |
| CreateResourceRelationshipRule( | |
| agent, | |
| ResourceRelationshipRule{ | |
| SourceKind: "GoogleCloudSQL", | |
| SourceVersion: "ctrlplane.dev/database/v1", | |
| TargetKind: "GoogleNetwork", | |
| TargetVersion: "ctrlplane.dev/network/v1", | |
| }, | |
| ) | |
| … |
Summary by CodeRabbit